# -*- coding: UTF-8 -*-
# Author: Damon(wuud1)
# CreateDate:
# Message:

# from lxml import etree
#
# file_name = '/Users/duanmengdi/Desktop/workspace/hengest_html/8182f6a9bb83673c54f10d7f5d836652.html'
#
# with open(file_name, 'r') as f:
#     res = f.read()
# html = etree.HTML(res)
#
# # tr_list = html.xpath('//div[@class="table-responsive-wrapper"][1]/table[@id="result-table"]/tbody/tr')
# # tr_list = html.xpath(u'//th[text()="生产厂家原备件-/其他厂家号"]/../../../tbody/tr')
# tr_list = html.xpath(u'//th[@data-sort="manufacturer_name"]/../../../tbody/tr')
# for tr in tr_list:
#     brand_name1 = tr.xpath('./td[2]/div/text()')
#     brand_name1 = brand_name1[0].strip().replace(' ', '') if len(brand_name1) > 0 else ""
#
#     pid1 = tr.xpath('./td[1]/div/text()')
#     pid1 = pid1[0].strip().replace(' ', '').replace('-', '') if len(pid1) > 0 else ""
#
#     print brand_name1, pid1

# dict1 = dict(
#     a=' ',
#     b=''
# )
#
# print dict1['a']
# print dict1['b']
#
# print dict1.get('a')
# print dict1.get('b')

# for i in range(1, 1002):
#     if i % 100 == 0:
#         print i

# import pymysql

# db_config = dict(
#         host="127.0.0.1",
#         port=3306,
#         user="root",
#         passwd="123456",
#         db="my_data",
#         charset="utf8")
#
# conn = pymysql.connect(**db_config)
# curs = conn.cursor()
#
# sql = '''select brand,item,pid from 0716_pid'''  # 查询sql的语句
# curs.execute(sql)
#
# curs.close()
# conn.close()
